package com.qingke.oms.util;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class PropertyManager {
	private static PropertyManager instance=null;
	private Properties properties=null;
	
	{
		properties=new Properties();
		try {
			properties.load(new FileReader("jdbc.properties"));
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	private PropertyManager(){
		
	}
	
	public static synchronized PropertyManager getInstance(){
		if(instance==null){
			instance=new PropertyManager();
		}
		return instance;
	}
	public String getProperty(String key){
		if(properties.getProperty(key)==null){
			properties.put(key,new String(""));
		}
		
		return properties.getProperty(key);
	}
}
